package com.example.gittest.controller;

import com.example.gittest.pojo.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class UserController {

    @RequestMapping("/index")
    public String hello(Model model){
        System.out.println("index....");

        List<Student> list=new ArrayList<>();
        list.add(new Student(1L,"幸福哈",22));
        list.add(new Student(2L,"张三",23));
        list.add(new Student(3L,"李四",24));

        model.addAttribute("list",list);

        return "index";
    }
}
